# Maintainer: Bruno Pagani <archange@archlinux.org>

_pkg=pygeos
pkgname=python-${_pkg}
pkgver=0.14
pkgrel=2
pkgdesc="Wraps GEOS geometry functions in numpy ufuncs"
arch=(loong64 x86_64)
url="https://pygeos.readthedocs.io/"
license=(BSD)
depends=(geos python-numpy)
makedepends=(cython python-setuptools)
checkdepends=(python-pytest)
source=(https://files.pythonhosted.org/packages/source/${_pkg::1}/${_pkg}/${_pkg}-${pkgver}.tar.gz)
sha256sums=('30fbc17f64844200b85133b885fcfb65541b8779531f6ef4f8fe467d3fba7623')

build() {
  cd ${_pkg}-${pkgver}
  python setup.py build
}

# ModuleNotFoundError: No module named 'pygeos.lib'
#check() {
#  cd ${_pkg}-${pkgver}
#  local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
#  PYTHONPATH="${PWD}"/build/lib.linux-$CARCH-${python_version} pytest -vv --color=yes
#}

package() {
  cd ${_pkg}-${pkgver}
  python setup.py install --prefix=/usr --root="${pkgdir}" --skip-build --optimize=1
  install -Dm644 LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgname}
}
